package cn.iocoder.yudao.module.contract.dal.mysql.invoice;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.contract.dal.dataobject.invoice.InvoiceOrdersDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 发票订单信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface InvoiceOrdersMapper extends BaseMapperX<InvoiceOrdersDO> {

    default PageResult<InvoiceOrdersDO> selectPage(PageParam reqVO, String ddSqkpRecordId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InvoiceOrdersDO>()
            .eq(InvoiceOrdersDO::getDdSqkpRecordId, ddSqkpRecordId)
            .orderByDesc(InvoiceOrdersDO::getId));
    }

    default int deleteByZskpId(String zskpId) {
        return delete(InvoiceOrdersDO::getZskpId, zskpId);
    }

    void batchInsertOrders(@Param("list") List<InvoiceOrdersDO> invoiceOrdersList);
}